package main;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class Logman {
    private static Logger LOGGER = null;

    public static void init() {
        //comment it since we don't need log4
        //LOGGER = LogManager.getLogger("wlxsphb_backend");

    }

    public static void debug(String info) {
        if (LOGGER != null) {
            LOGGER.debug(info);
        }
        else {
            System.out.println("[DEBUG]: " + info);
        }
    }

    public static void error(String info) {
        if (LOGGER != null) {
            LOGGER.error(info);
        }
        else {
            System.out.println("[ERROR]: " + info);
        }
    }

    public static void fatal(String info) {
        if (LOGGER != null) {
            LOGGER.fatal(info);
        }
        else {
            System.out.println("[FATAL]: " + info);
        }
    }

    public static void info(String info) {
        if (LOGGER != null) {
            LOGGER.info(info);
        }
        else {
            System.out.println("[INFO]:" + info);
        }
    }

    public static void trace(String info) {
        if (LOGGER != null) {
            LOGGER.trace(info);
        }
        else {
            System.out.println("[TRACE]:" + info);
        }
    }
}
